<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=0.2, minimum-scale=0.23, maximum-scale=1.0, user-scalable=no">
<title>管理后台用户</title>
<link type="text/css" href="/common/css/common.css" rel="stylesheet"/>
<style type="text/css">
	td.do{text-align:left; padding-left:10px;}
</style>
<link rel="stylesheet" href="/manage/assets/css/bootstrap.min.css">
<!-- <script type="text/javascript" src="/common/js/common.js"></script>
<script type="text/javascript" src="/common/js/jquery1.8.3.js"></script> -->
<script type="text/javascript">
	function update(userName){
		if(userName=='administrator'){
			alert("只有“administrator”才有权限修改该账户信息！！");
			return;
		}else{
			alert('ok11');
			window.location.href="/user/toEdit?username="+userName;
		}
	}
	function del(userName){
		if(userName=="administrator"){
			alert("“administrator”是最高权限的管理员账户，禁止删除！！");
			return;
		}else if(userName=='<s:property value="#session.backUser.userName"/>'){
			alert("自己不能删除自己的账户！！");
			return;
		}
		if(confirm("你确认要删除用户“"+userName+"”吗？")) {
			window.location.href="/userAction!delete.chtml?u.userName="+userName;
		}	
	}
	function setSot(userName,status){
		window.location.href="/userAction!updateStatus.chtml?u.status="+status+"&u.userName="+userName;
	}
</script>
</head>
<body>
<form action="/infoAction!list.chtml" method="post">
</form>
		
<div class="card">
	<div class="card-header">
		<strong class="card-title">列表</strong>
		<button type="button" class="btn btn-primary" style="float:right" onclick="window.location.href='/user/toAdd'"> 新增</button>
	</div>
	<div class="card-body">
		<table id="bootstrap-data-table" class="table table-striped table-bordered">
          <tr>
            <th>ID</th>
            <th>登录用户名</th>
			<th>名字</th>
            <th>操作</th>
          </tr>
          <tr th:each="d,iterStat : ${userList}">
          	  <td th:text="${d.id}"></td>
              <td th:text="${d.username}"></td>
              <td th:text="${d.name}"></td>
              <td class="do">
              	  <a th:href="@{'javascript:update(\''+(${d.username})+'\')'}"><img src="/manage/images/tab/edt.gif"/>修改</a>
              </td>
          </tr>
        </table></div></div>
</body>
</html>
